package com.fanchuan.uzx.db;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.DaoConfig;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.IdentityScopeType;

import com.fanchuan.uzx.db.OfferDB;
import com.fanchuan.uzx.db.LectureDB;
import com.fanchuan.uzx.db.NewsDB;

import com.fanchuan.uzx.db.OfferDBDao;
import com.fanchuan.uzx.db.LectureDBDao;
import com.fanchuan.uzx.db.NewsDBDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig offerDBDaoConfig;
    private final DaoConfig lectureDBDaoConfig;
    private final DaoConfig newsDBDaoConfig;

    private final OfferDBDao offerDBDao;
    private final LectureDBDao lectureDBDao;
    private final NewsDBDao newsDBDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        offerDBDaoConfig = daoConfigMap.get(OfferDBDao.class).clone();
        offerDBDaoConfig.initIdentityScope(type);

        lectureDBDaoConfig = daoConfigMap.get(LectureDBDao.class).clone();
        lectureDBDaoConfig.initIdentityScope(type);

        newsDBDaoConfig = daoConfigMap.get(NewsDBDao.class).clone();
        newsDBDaoConfig.initIdentityScope(type);

        offerDBDao = new OfferDBDao(offerDBDaoConfig, this);
        lectureDBDao = new LectureDBDao(lectureDBDaoConfig, this);
        newsDBDao = new NewsDBDao(newsDBDaoConfig, this);

        registerDao(OfferDB.class, offerDBDao);
        registerDao(LectureDB.class, lectureDBDao);
        registerDao(NewsDB.class, newsDBDao);
    }
    
    public void clear() {
        offerDBDaoConfig.getIdentityScope().clear();
        lectureDBDaoConfig.getIdentityScope().clear();
        newsDBDaoConfig.getIdentityScope().clear();
    }

    public OfferDBDao getOfferDBDao() {
        return offerDBDao;
    }

    public LectureDBDao getLectureDBDao() {
        return lectureDBDao;
    }

    public NewsDBDao getNewsDBDao() {
        return newsDBDao;
    }

}
